import 'package:event_bus/event_bus.dart';

///事件总线
abstract class CustomEventBus {
  static EventBus? _instance;

  static EventBus getInstance() {
    _instance ??= EventBus();
    return _instance!;
  }
}

///evenBus的实体类
class MyEntity {
  MyEntity(this.type, this.data);

  ///事件类型
  // url播放 资源附件
  static const String TYPEDIRECTORYFILE = 'typeDirectoryFile';

  // 目录id
  static const String TYPEDIRECTORYFILEID = 'typeDirectoryFileId';

  // 设置视频进度
  static const String DEADLINE = 'deadline';

  // 课程详情 评价数量
  static const String TYPECOURSEDETAILEVALUATECOUNT = 'typeCourseDetailEvaluateCount';

  // 刷星界面
  static const String TYPEPAGEREFASH = 'typePageRehash';

  // 刷星界面
  static const String TYPGETPLANBYTEXTBOOKID = 'typeGetPlanByTextBookId';

  final String type;
  final dynamic data;
}
